// To parse this JSON data, do
//
//     final welcome = welcomeFromJson(jsonString);

import 'dart:convert';

GroupUser groupUserFromJson(String str) => GroupUser.fromJson(json.decode(str));

String groupUserToJson(GroupUser data) => json.encode(data.toJson());

class GroupUser {
  GroupUser(
      {this.role,
      this.groupId,
      this.userId,
      this.v,
      this.userInfo,
      this.checked,
      this.id});

  int role;
  String groupId;
  String userId;
  int v;
  UserInfo userInfo;
  bool checked;
  String id;
  factory GroupUser.fromJson(Map<String, dynamic> json) => GroupUser(
        role: json["role"],
        groupId: json["group_id"],
        userId: json["user_id"],
        v: json["__v"],
        userInfo: UserInfo.fromJson(json["user_info"]),
        checked: json["checked"],
        id: json["id"],
      );

  Map<String, dynamic> toJson() => {
        "role": role,
        "group_id": groupId,
        "user_id": userId,
        "__v": v,
        "user_info": userInfo.toJson(),
        "id": id,
        "checked": checked,
      };
}

class UserInfo {
  UserInfo({
    this.id,
    this.userId,
    this.token,
    this.phoneNumber,
    this.createdAt,
    this.updatedAt,
    this.v,
    this.avatar,
  });

  String id;
  String userId;
  String token;
  String phoneNumber;
  String createdAt;
  String updatedAt;
  int v;
  String avatar;

  factory UserInfo.fromJson(Map<String, dynamic> json) => UserInfo(
        id: json["_id"],
        userId: json["userId"],
        token: json["token"],
        phoneNumber: json["phoneNumber"],
        createdAt: json["createdAt"],
        updatedAt: json["updatedAt"],
        v: json["__v"],
        avatar: json["avatar"],
      );

  Map<String, dynamic> toJson() => {
        "_id": id,
        "userId": userId,
        "token": token,
        "phoneNumber": phoneNumber,
        "createdAt": createdAt,
        "updatedAt": updatedAt,
        "__v": v,
        "avatar": avatar,
      };
}
